package com.example.gorannet;

import java.util.ArrayList;
import java.util.List;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ArrayAdapter;
import android.widget.ListView;

public class MyChoicesActivity extends Activity implements OnItemClickListener {

	@Override
	public void onCreate(Bundle savedInstanceState) 
	{
		super.onCreate(savedInstanceState);
		setContentView(R.layout.mychoicelist);
		ListView listView = (ListView)findViewById(R.id.lv11);
        List<String> listData = new ArrayList<String>();
        listData.add("Tickets");
        listData.add("GCM");
        listData.add("Settings");
        listView.setAdapter(new ArrayAdapter<String>(getApplicationContext(), R.layout.list_item, R.id.listItem, listData));
        listView.setOnItemClickListener(this);
	}
	 @Override
	    public boolean onCreateOptionsMenu(Menu menu)
	    {
	        MenuInflater menuInflater = getMenuInflater();
	        menuInflater.inflate(R.layout.menu, menu);
	        return true;
	    }
	@Override
	public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {
		// TODO Auto-generated method stub
		
		if(arg2 == 0)
		{
			Intent i = new Intent(getApplicationContext(), TicketsActivity.class);
        	startActivityForResult(i, 0);		
		}
		if(arg2 == 1)
		{
			Intent i = new Intent(getApplicationContext(), GCMmessagAc.class);
        	startActivityForResult(i, 0);
		}
		if(arg2 == 2)
		{			
        	Intent i = new Intent(getApplicationContext(), AppSettingsActivity.class);
        	startActivityForResult(i, 0);
		}
	}

}